
#ifndef UCDB_OBJECTCONTEXTCOLLECTION_H
#define UCDB_OBJECTCONTEXTCOLLECTION_H

#pragma once

#include "zacdb.h"
#include "zdbmain.h"
#include "zAcString.h"
#include "zdbObjContext.h"

#pragma pack (push, 8)

class UcDbObjectContextCollectionIterator;

class ZSOFT_NO_VTABLE UcDbObjectContextCollection: public UcRxObject
{
public:
    UCRX_DECLARE_MEMBERS(UcDbObjectContextCollection);
    virtual UcString            name() const = 0;
    virtual UcDbObjectContext*  currentContext(
                        const UcDbObject* pRequestingObject) const = 0;
    virtual Ucad::ErrorStatus   setCurrentContext(
                                        const UcDbObjectContext* pContext) = 0;
    virtual Ucad::ErrorStatus   addContext(
                                        const UcDbObjectContext* pContext) = 0;
    virtual Ucad::ErrorStatus   removeContext(
                                        const UcString& contextName) = 0;
    virtual Ucad::ErrorStatus   lockContext(
                                        const UcDbObjectContext* pContext) = 0;
    virtual Ucad::ErrorStatus   unlockContext() = 0;
    virtual bool                locked() const = 0;
    virtual UcDbObjectContext*  getContext(
                                        const UcString& contextName) const = 0;
    virtual bool                hasContext(
                                        const UcString& contextName) const = 0;
    virtual UcDbObjectContextCollectionIterator* newIterator() const = 0;
};

class ZSOFT_NO_VTABLE UcDbObjectContextCollectionIterator : public UcRxObject
{
public:
    UCRX_DECLARE_MEMBERS(UcDbObjectContextCollectionIterator);
    virtual Ucad::ErrorStatus start() = 0;
    virtual bool              next() = 0;
    virtual bool              done() const = 0;
    virtual Ucad::ErrorStatus getContext(UcDbObjectContext*& pObjectContext) const = 0;
};
#pragma pack (pop)

#endif
